// 封装文章相关的接口
import axios from '@/utils/request'

// 获取面经列表 /h5/interview/query
export function interviewListApi (params) {
//   return axios.get('/interview/query', { params })
  return axios({
    url: '/interview/query',
    params
    // headers: {
    //   Authorization: 'Bearer ' + getItem()
    // }
  })
}

// 面经详情 /h5/interview/show
export function detailApi (id) {
  return axios({
    url: '/interview/show',
    params: { id: id }
  })
}

// 收藏 /h5/interview/opt
export function collectAip (id) {
  return axios({
    url: '/interview/opt',
    method: 'post',
    data: {
      id,
      optType: 2
    }
  })
}

// 点赞
export function likeAip (id) {
  return axios({
    url: '/interview/opt',
    method: 'post',
    data: {
      id,
      optType: 1
    }
  })
}

// 收藏列表 /h5/interview/opt/list
export function collectListApi (params) {
  return axios({
    url: '/interview/opt/list',
    params: {
      optType: 2,
      ...params
    }
  })
}

// 点赞列表 /h5/interview/opt/list
export function likeListApi (params) {
  return axios({
    url: '/interview/opt/list',
    params: {
      optType: 1,
      ...params
    }
  })
}
